/**
 * 国际化翻译混入
 * 提供全局翻译函数 t() 和语言切换功能
 */
export default {
  computed: {
    currentLanguage() {
      return this.$store.state.web.language || 'zh';
    }
  },
  methods: {
    /**
     * 翻译函数
     * @param {String} key 翻译键
     * @returns {String} 翻译后的文本
     */
    t(key) {
      const lang = this.currentLanguage;
      const translations = {
        zh: {
          // 基础
          systemName: '学术会议管理系统',
          home: '首页',
          announcements: '公告消息',
          news: '新闻通知',
          more: '更多',
          myAccount: '我的',
          personalCenter: '个人中心',
          logout: '退出',
          menu: '菜单',
          searchPlaceholder: '输入关键词',
          personalInfo: '个人资料',
          changePassword: '密码修改',
          myRegistrations: '我的报名',
          favorites: '收藏',
          nickname: '昵称',
          role: '角色',
          logoutBtn: '退出登录',
          login: '登录',
          register: '注册',
          // 登录注册
          username: '用户名',
          account: '账号',
          password: '密码',
          forgotPassword: '忘记密码',
          noAccount: '没有账户?',
          createAccount: '创建一个账户',
          accountLogin: '账号登录',
          phoneQuickLogin: '手机快捷登录',
          overseasPhoneLogin: '海外手机登录',
          registerNow: '立即注册',
          alreadyHaveAccount: '已有账号?',
          loginNow: '马上登录',
          systemSubtitle: '科研领域的连接者',
          phoneRegistration: '手机注册',
          emailRegistration: '邮箱注册',
          phoneNumber: '手机号码',
          emailAddress: '邮箱地址',
          verificationCode: '验证码',
          getVerificationCode: '获取验证码',
          getSmsCode: '获取验证码',
          smsVerificationCode: '短信验证码',
          imageVerificationCode: '图形验证码',
          agreeToTerms: '同意《用户协议》与《隐私协议》',
          confirm: '确认',
          enterPhoneNumber: '请输入手机号码',
          enterEmailAddress: '请输入邮箱地址',
          enterPassword: '请输入密码',
          enterVerificationCode: '请输入验证码',
          enterSmsVerificationCode: '请输入短信验证码',
          enterImageVerificationCode: '请输入图形验证码',
          enterAccount: '请输入账号（5-16个字符）',
          enterNickname: '请输入昵称（2-12个字符）',
          enterPhoneOrEmail: '请输入手机号码/邮箱账号',
          retryAfterSeconds: '秒后重试',
          verificationCodeSent: '验证码已发送，请查收',
          pleaseAgreeToTerms: '请同意用户协议和隐私协议',
          registrationSuccess: '注册成功!',
          // 功能列表
          academicConference: '学术会议',
          articleManagement: '文章管理',
          announcementNews: '公告消息',
          conferenceRegistration: '参会报名',
          callForPapersTopics: '征稿主题',
          contactUs: '联系我们',
          collectionManagement: '收藏管理',
          verification: '验证',
          submit: '提交',
          loginSuccess: '登录成功！',
          // 报名相关
          myRegistrationsTitle: '我的报名',
          viewAllRegistrations: '查看您所有的会议报名记录',
          unnamedConference: '未命名会议',
          examined: '已审核',
          notExamined: '未审核',
          paid: '已支付',
          unpaid: '待支付',
          meetingNumber: '会议编号',
          meetingTime: '会议时间',
          meetingVenue: '会议地点',
          participationAmount: '参会金额',
          paymentMethod: '支付方式',
          registrationTime: '报名时间',
          goToPayment: '去支付',
          viewDetails: '查看详情',
          noRegistrations: '您还没有任何报名记录',
          registerNow: '立即报名',
          // 会议详情页
          countdownLabel: '距离会议开始还有：',
          meetingStarted: '会议已开始',
          registerForMeeting: '参会报名',
          submitPaper: '论文投稿',
          meetingInfo: '会议信息',
          conferenceOverview: '大会简介',
          // 会议详情字段
          conferenceName: '会议名称',
          meetingNumber: '会议编号',
          meetingType: '会议类型',
          meetingTime: '会议时间',
          meetingVenue: '会议地点',
          participationFee: '参会金额',
          siteEquipment: '场所设备',
          conferenceIntroduction: '会议简介',
          meetingCover: '会议封面',
          organizerHost: '主办单位',
          organizerCo: '协办单位',
          organizerSupport: '支持单位',
          venueEquipment: '场所设备',
          accommodationRecommendation: '住宿推荐',
          committeeMembers: '大会组委',
          speakers: '报告嘉宾',
          callForPapers: '征稿主题',
          importantInfo: '重要信息',
          finalDeadline: '终稿截稿时间：',
          submissionDeadline: '截稿时间',
          acceptRejectNotice: '接受/拒稿通知：',
          acceptRejectNoticeValue: '投稿后3-7个工作日',
          indexing: '收录检索：',
          indexingValue: 'IEEE Xplore、EI Compendex、Scopus',
          // 会议列表
          meetingNumberLabel: '会议编号',
          meetingNameLabel: '会议名称',
          meetingTypeLabel: '会议类型',
          meetingTimeLabel: '会议时间',
          meetingVenueLabel: '会议地点',
          participationAmountLabel: '参会金额',
          userNameLabel: '用户姓名',
          examineStateLabel: '审核状态',
          paymentStatusLabel: '支付状态',
          accommodationRequired: '是否住宿',
          registrationDetailsTitle: '报名详情',
          siteEquipment: '场所设备',
          meetingCover: '会议封面',
          conferenceIntroduction: '会议简介',
          // 报名相关
          registrationInfo: '参会信息',
          registrationType: '注册类型',
          registrationDeadline: '注册截止',
          attendeeInfo: '参会人信息',
          accommodationInfo: '住宿信息',
          mealInfo: '用餐信息',
          orderSummary: '订单支付',
          // 其他
          days: '天',
          hours: '时',
          minutes: '分',
          seconds: '秒',
          totalPeople: '总人数',
          accommodation: '住宿',
          meal: '用餐',
          userName: '用户姓名',
          accommodationStatus: '是否住宿',
          yes: '是',
          no: '否',
          orderPayment: '订单支付',
          orderDetails: '订单详情',
          attendeeCount: '参会人数',
          person: '人',
          totalRegistrationFee: '注册费用总计',
          registrationTypeLabel: '注册类型',
          unitPrice: '单价(¥)',
          quantity: '数量',
          subtotal: '小计(¥)',
          total: '总计',
          stepLabel: '订单支付',
          // 通用
          save: '保存',
          cancel: '取消',
          confirm: '确认',
          delete: '删除',
          edit: '编辑',
          add: '添加',
          search: '搜索',
          reset: '重置',
          submit: '提交',
          loading: '加载中...',
          noData: '暂无数据',
          // 会议信息
          meetingList: '会议信息列表',
          keywordSearch: '关键字搜索：',
          meetingNumberSearch: '会议编号搜索',
          meetingNameSearch: '会议名称搜索',
          dropdownSearch: '下拉搜索：',
          sort: '排序',
          // 公告
          noticeList: '公告列表',
          noticeTitle: '公告消息',
          // 文章
          articleList: '文章列表',
          localSearch: '局部搜索',
          articleHotList: '文章热门列表',
          hotArticleRecommendation: '热门文章推荐',
          commentSection: '评论区',
          replyTo: '对',
          reply: '回复',
          resetReply: '重置回复人',
          // 用户相关
          myMessages: '我的消息',
          myFavorites: '我的收藏',
          saveDraft: '保存草稿',
          // 首页
          conferenceNews: '会议资讯',
          recommendedConferenceInfo: '会议信息推荐',
          friendlyLinks: '友情链接',
          switchToTable: '切换表格',
          switchToList: '切换列表',
          searchResults: '搜索结果',
          // 消息相关
          myMessagesTitle: '我的消息',
          unreadMessages: '您有 {count} 条未读消息',
          markAllAsRead: '全部标记已读',
          deleteSelected: '删除选中',
          clearAll: '清空全部',
          refresh: '刷新',
          unread: '未读',
          noMessages: '暂无消息',
          messageDetail: '消息详情',
          messageType: '消息类型',
          messageTitle: '标题',
          messageContent: '内容',
          sendTime: '发送时间',
          // 消息内容固定文本
          hello: '您好',
          youHaveNewConferenceNotification: '您有新的会议通知：',
          pleaseCheckDetailsInTime: '请及时查看详情。',
          yourAccommodationArrangementConfirmed: '您的住宿安排已确认：',
          yourSeatArrangementConfirmed: '您的座位安排已确认：',
          pleaseCheckInOnTime: '请按时入住，如有疑问请联系会务组。',
          pleaseTakeSeatAccordingToNumber: '请按座位号就座，感谢配合。',
          conference: '会议：',
          accommodationLocation: '住宿地点：',
          roomNumber: '房间号：',
          seatNumber: '座位号：',
          meetingVenueColon: '会议地点：',
          // 筛选
          filter: '筛选',
          // 通知
          notification: '通知',
          close: '关闭',
          markAsReadAndClose: '标记已读并关闭',
          time: '时间',
          // 收藏
          favoritesList: '收藏列表',
          // 联系我们
          contactUs: '联系我们',
          contactCompany: '公司',
          contactAddress: '地址',
          contactEmail: '邮箱',
          contactWebsite: '网址',
          messageTitle: '留言标题',
          messageContent: '留言内容',
          yourEmail: '您的邮箱地址',
          verificationCode: '验证码',
          submitMessage: '提交留言',
          messageSubmitted: '留言提交成功！',
          scanQRCode: '扫一扫上面的二维码图像，添加好友',
          submitting: '提交中...',
          // 用户组翻译
          administrator: '管理员',
          user: '用户',
          expert: '专家',
          guest: '游客',
          // 导航路径映射
          meetingInformationList: '会议信息列表',
          advertisementList: '广告列表',
          adList: '广告列表',
          // 时间
          createTime: '创建时间',
          updateTime: '更新时间',
          // 状态
          status: '状态',
          // 验证消息
          accountLengthError: '账户名长度为在5-16个字符',
          passwordLengthError: '密码长度为在5-16个字符',
          validationPassed: '校验通过',
          enterCorrectAccount: '请输入正确账号',
          enterCorrectPassword: '请输入正确密码',
          pleaseVerify: '请进行拖拽检验',
          verificationSuccess: '哇塞~检验成功，速度战胜99%的用户，请进行登录',
          // 注册表单相关
          attendee: '参会人',
          addAttendee: '新增参会人',
          name: '姓名',
          phone: '手机',
          mobile: '手机',
          workUnit: '工作单位',
          affiliation: 'Affiliation/单位',
          speechTitle: 'Speech Title/报告标题',
          title: 'Title/职称',
          wechat: 'WeChat/微信',
          participationType: 'Participation Type/参会类型',
          online: 'Online/线上',
          onsite: 'Onsite/线下',
          needAccommodation: '是否需要住宿 (Accommodation)',
          orderNotes: '订单备注',
          orderNotesPlaceholder: '请留言您的订单备注',
          orderInformation: '订单信息',
          orderNumber: '订单编号',
          paymentAmountLabel: '支付金额',
          collapseDetails: '详情收起',
          conferencePeriod: '会议时期',
          numberOfParticipants: '参会人数',
          registrationFeeDetails: '注册费用明细',
          // 评论相关
          postComment: '发表评论',
          post: '发表',
          insertTextHere: 'Insert text here...',
          contentCannotBeEmpty: '输入内容不能为空',
          // 文章相关
          likes: '点赞数',
          clicks: '点击数',
          favorite: '收藏',
          like: '点赞',
          likeSuccess: '点赞成功',
          cancelLike: '取消点赞',
          collectSuccess: '收藏成功',
          cancelCollect: '取消收藏',
          // 用户中心相关
          avatar: '头像',
          changeAvatar: '修改头像',
          changeNickname: '修改昵称',
          enterOriginalPassword: '输入原始密码',
          originalPassword: '原始密码',
          setNewPassword: '设置新密码',
          confirmPassword: '确认密码',
          confirmModify: '确认修改',
          save: '保存',
          userNameField: '用户姓名',
          accommodationStatus: '是否住宿',
          passwordMismatch: '密码不一致',
          // 错误消息
          attendeeNameRequired: '参会人姓名不能为空',
          attendeePhoneRequired: '参会人手机号不能为空',
          attendeeWorkUnitRequired: '参会人工作单位不能为空',
          attendeeSpeechTitleRequired: '参会人报告标题不能为空',
          attendeeNumber: '第{index}位{field}不能为空'
        },
        en: {
          // 基础
          systemName: 'Academic Conference Management System',
          home: 'Home',
          announcements: 'Announcements',
          news: 'News',
          more: 'More',
          myAccount: 'My Account',
          personalCenter: 'Personal Center',
          logout: 'Logout',
          menu: 'Menu',
          searchPlaceholder: 'Enter keywords',
          personalInfo: 'Personal Information',
          changePassword: 'Change Password',
          myRegistrations: 'My Registrations',
          favorites: 'Favorites',
          nickname: 'Nickname',
          role: 'Role',
          logoutBtn: 'Logout',
          login: 'Login',
          register: 'Register',
          // 登录注册
          username: 'Username',
          account: 'Account',
          password: 'Password',
          forgotPassword: 'Forgot Password',
          noAccount: 'No account?',
          createAccount: 'Create an account',
          accountLogin: 'Account Login',
          phoneQuickLogin: 'Phone Quick Login',
          overseasPhoneLogin: 'Overseas Phone Login',
          registerNow: 'Register Now',
          alreadyHaveAccount: 'Already have an account?',
          loginNow: 'Log in now',
          systemSubtitle: 'Connectors in the field of scientific research',
          phoneRegistration: 'Phone Registration',
          emailRegistration: 'Email Registration',
          phoneNumber: 'Phone Number',
          emailAddress: 'Email Address',
          verificationCode: 'Verification Code',
          getVerificationCode: 'Get Verification Code',
          getSmsCode: 'Get Verification Code',
          smsVerificationCode: 'SMS Verification Code',
          imageVerificationCode: 'Image Verification Code',
          agreeToTerms: 'Agree to "User Agreement" and "Privacy Policy"',
          confirm: 'Confirm',
          enterPhoneNumber: 'Please enter phone number',
          enterEmailAddress: 'Please enter email address',
          enterPassword: 'Please enter password',
          enterVerificationCode: 'Please enter verification code',
          enterSmsVerificationCode: 'Please enter SMS verification code',
          enterImageVerificationCode: 'Please enter image verification code',
          enterAccount: 'Please enter account (5-16 characters)',
          enterNickname: 'Please enter nickname (2-12 characters)',
          enterPhoneOrEmail: 'Please enter phone number/email account',
          retryAfterSeconds: 'seconds before retry',
          verificationCodeSent: 'Verification code sent, please check',
          pleaseAgreeToTerms: 'Please agree to user agreement and privacy policy',
          registrationSuccess: 'Registration successful!',
          // 功能列表
          academicConference: 'Academic Conference',
          articleManagement: 'Article Management',
          announcementNews: 'Announcement News',
          conferenceRegistration: 'Conference Registration',
          callForPapersTopics: 'Call for Papers Topics',
          contactUs: 'Contact Us',
          collectionManagement: 'Collection Management',
          verification: 'Verification',
          submit: 'Submit',
          loginSuccess: 'Login successful!',
          // 报名相关
          myRegistrationsTitle: 'My Registrations',
          viewAllRegistrations: 'View all your conference registration records',
          unnamedConference: 'Unnamed Conference',
          examined: 'Examined',
          notExamined: 'Not Examined',
          paid: 'Paid',
          unpaid: 'Unpaid',
          meetingNumber: 'Meeting Number',
          meetingTime: 'Meeting Time',
          meetingVenue: 'Meeting Venue',
          participationAmount: 'Participation Amount',
          paymentMethod: 'Payment Method',
          registrationTime: 'Registration Time',
          goToPayment: 'Go to Payment',
          viewDetails: 'View Details',
          noRegistrations: 'You have no registration records yet',
          registerNow: 'Register Now',
          // 会议详情页
          countdownLabel: 'Time until meeting starts:',
          meetingStarted: 'Meeting has started',
          registerForMeeting: 'Register for Meeting',
          submitPaper: 'Submit Paper',
          meetingInfo: 'Meeting Information',
          conferenceOverview: 'Conference Overview',
          // 会议详情字段
          conferenceName: 'Conference Name',
          meetingNumber: 'Meeting Number',
          meetingType: 'Meeting Type',
          meetingTime: 'Meeting Time',
          meetingVenue: 'Meeting Venue',
          participationFee: 'Participation Fee',
          siteEquipment: 'Site Equipment',
          conferenceIntroduction: 'Conference Introduction',
          meetingCover: 'Meeting Cover',
          organizerHost: 'Organizer',
          organizerCo: 'Co-organizer',
          organizerSupport: 'Supporting Organization',
          venueEquipment: 'Venue Equipment',
          accommodationRecommendation: 'Accommodation Recommendation',
          committeeMembers: 'Committee Members',
          speakers: 'Speakers',
          callForPapers: 'Call for Papers',
          importantInfo: 'Important Information',
          finalDeadline: 'Final Submission Deadline:',
          submissionDeadline: 'Submission Deadline',
          acceptRejectNotice: 'Accept/Reject Notice:',
          acceptRejectNoticeValue: '3-7 business days after submission',
          indexing: 'Indexing:',
          indexingValue: 'IEEE Xplore, EI Compendex, Scopus',
          // 会议列表
          meetingNumberLabel: 'Meeting Number',
          meetingNameLabel: 'Meeting Name',
          meetingTypeLabel: 'Meeting Type',
          meetingTimeLabel: 'Meeting Time',
          meetingVenueLabel: 'Meeting Venue',
          participationAmountLabel: 'Participation Amount',
          userNameLabel: 'User Name',
          examineStateLabel: 'Examination Status',
          paymentStatusLabel: 'Payment Status',
          accommodationRequired: 'Accommodation Required',
          registrationDetailsTitle: 'Registration Details',
          siteEquipment: 'Site Equipment',
          meetingCover: 'Meeting Cover',
          conferenceIntroduction: 'Conference Introduction',
          // 报名相关
          registrationInfo: 'Registration Information',
          registrationType: 'Registration Type',
          registrationDeadline: 'Registration Deadline',
          attendeeInfo: 'Attendee Information',
          accommodationInfo: 'Accommodation Information',
          mealInfo: 'Meal Information',
          orderSummary: 'Order Payment',
          // 其他
          days: 'days',
          hours: 'hours',
          minutes: 'minutes',
          seconds: 'seconds',
          totalPeople: 'Total People',
          accommodation: 'Accommodation',
          meal: 'Meal',
          userName: 'User Name',
          accommodationStatus: 'Accommodation Status',
          yes: 'Yes',
          no: 'No',
          orderPayment: 'Order Payment',
          orderDetails: 'Order Details',
          attendeeCount: 'Attendee Count',
          person: 'person',
          totalRegistrationFee: 'Total Registration Fee',
          registrationTypeLabel: 'Registration Type',
          unitPrice: 'Unit Price (¥)',
          quantity: 'Quantity',
          subtotal: 'Subtotal (¥)',
          total: 'Total',
          stepLabel: 'Order Payment',
          callForPapersNotice: '(Papers related to AI, Computer Engineering, Big Data and their applications are welcome. Pre-review takes 1-2 business days. *If uncertain about topics, please consult the conference secretary.)',
          timeTBD: 'Time TBD',
          step1: 'Registration Info',
          step2: 'Order Payment',
          step3: 'Complete',
          quantityLabel: 'Quantity',
          totalPrice: 'Total Price (¥)',
          subtotalLabel: 'Subtotal (¥)',
          unitPriceLabel: 'Unit Price',
          totalAmount: 'Total Amount',
          totalPriceLabel: 'Total Price',
          orderDetailsTitle: 'Order Details',
          tips: 'Tips',
          tipsInfo1: 'Please ensure all information is accurate',
          tipsInfo2: 'Registration type cannot be modified after submission',
          tipsInfo3: 'Please complete payment before the deadline',
          tipsInfo4: 'If you have any questions, please contact the conference organizing committee',
          myAccount: 'My Account',
          myMessages: 'My Messages',
          myFavorites: 'My Favorites',
          selectPaymentMethod: 'Select Payment Method',
          onlinePayment: 'Online Payment',
          alipay: 'Alipay',
          wechatPay: 'WeChat Pay',
          submitOrder: 'Submit Order',
          confirmPayment: 'Confirm Payment',
          paymentProcessing: 'Processing payment...',
          paymentSuccess: 'Payment Successful',
          paymentFailed: 'Payment Failed',
          morePaymentMethods: 'More Payment Methods >>',
          paymentAmount: 'Payment Amount',
          pleaseScanQRCode: 'Please use {method} to scan the QR code for payment',
          wechatPayQRCode: 'Please use WeChat to scan the QR code for payment',
          alipayQRCode: 'Please use Alipay to scan the QR code for payment',
          importantNotice: 'Important Notice:',
          sandboxNotice: 'Currently in sandbox environment. You must use {method} sandbox test account to scan and pay!',
          sandboxAccountRequired: 'Regular {method} account will show "QR code expired" when scanning.',
          getSandboxAccount: 'Get sandbox account: Alipay Open Platform → Developer Assistant → Sandbox App → Sandbox Account',
          realPaymentQRCode: 'Real payment QR code generated. Please use {method} to scan and pay',
          redirectingToPayment: 'Redirecting to {method} payment page...',
          payNow: 'Pay Now',
          paymentQRCode: 'Payment QR Code',
          generatingQRCode: 'Generating QR code...',
          refreshQRCode: 'Refresh QR Code',
          paymentAmountLabel: 'Payment Amount',
          mockQRCodeTip: 'This is a test QR code. Scanning will show expired. Please configure real payment parameters to use real payment.',
          // 通用
          save: 'Save',
          cancel: 'Cancel',
          confirm: 'Confirm',
          delete: 'Delete',
          edit: 'Edit',
          add: 'Add',
          search: 'Search',
          reset: 'Reset',
          submit: 'Submit',
          loading: 'Loading...',
          noData: 'No data',
          // 会议信息
          meetingList: 'Meeting Information List',
          keywordSearch: 'Keyword Search:',
          meetingNumberSearch: 'Meeting Number Search',
          meetingNameSearch: 'Meeting Name Search',
          dropdownSearch: 'Dropdown Search:',
          sort: 'Sort',
          // 公告
          noticeList: 'Notice List',
          noticeTitle: 'Announcements',
          // 文章
          articleList: 'Article List',
          localSearch: 'Local Search',
          articleHotList: 'Hot Articles',
          hotArticleRecommendation: 'Hot Article Recommendation',
          commentSection: 'Comment Section',
          replyTo: 'Reply to',
          reply: 'Reply',
          resetReply: 'Reset Reply',
          // 用户相关
          myMessages: 'My Messages',
          saveDraft: 'Save Draft',
          // 首页
          conferenceNews: 'Conference News',
          recommendedConferenceInfo: 'Recommended Conference Information',
          friendlyLinks: 'Friendly Links',
          switchToTable: 'Switch to Table',
          switchToList: 'Switch to List',
          searchResults: 'Search Results',
          // 消息相关
          myMessagesTitle: 'My Messages',
          unreadMessages: 'You have {count} unread messages',
          markAllAsRead: 'Mark All as Read',
          deleteSelected: 'Delete Selected',
          clearAll: 'Clear All',
          refresh: 'Refresh',
          unread: 'Unread',
          noMessages: 'No messages',
          messageDetail: 'Message Detail',
          messageType: 'Message Type',
          messageTitle: 'Title',
          messageContent: 'Content',
          sendTime: 'Send Time',
          // 消息内容固定文本
          hello: 'Hello',
          youHaveNewConferenceNotification: 'You have a new conference notification:',
          pleaseCheckDetailsInTime: 'Please check the details in time.',
          yourAccommodationArrangementConfirmed: 'Your accommodation arrangement has been confirmed:',
          yourSeatArrangementConfirmed: 'Your seat arrangement has been confirmed:',
          pleaseCheckInOnTime: 'Please check in on time. If you have any questions, please contact the conference organizing committee.',
          pleaseTakeSeatAccordingToNumber: 'Please take your seat according to the seat number. Thank you for your cooperation.',
          conference: 'Conference:',
          accommodationLocation: 'Accommodation Location:',
          roomNumber: 'Room Number:',
          seatNumber: 'Seat Number:',
          meetingVenueColon: 'Meeting Venue:',
          // 筛选
          filter: 'Filter',
          // 通知
          notification: 'Notification',
          close: 'Close',
          markAsReadAndClose: 'Mark as Read and Close',
          time: 'Time',
          // 收藏
          favoritesList: 'Favorites List',
          // 联系我们
          contactUs: 'Contact Us',
          contactCompany: 'Company',
          contactAddress: 'Address',
          contactEmail: 'Email',
          contactWebsite: 'Website',
          messageTitle: 'Message Title',
          messageContent: 'Message Content',
          yourEmail: 'Your Email Address',
          verificationCode: 'Verification Code',
          submitMessage: 'Submit Message',
          messageSubmitted: 'Message submitted successfully!',
          scanQRCode: 'Scan the QR code above to add friend',
          submitting: 'Submitting...',
          // 用户组翻译
          administrator: 'Administrator',
          user: 'User',
          expert: 'Expert',
          guest: 'Guest',
          // 导航路径映射
          meetingInformationList: 'Meeting Information List',
          advertisementList: 'Advertisement List',
          adList: 'Advertisement List',
          // 时间
          createTime: 'Create Time',
          updateTime: 'Update Time',
          // 状态
          status: 'Status',
          // 验证消息
          accountLengthError: 'Account name must be 5-16 characters',
          passwordLengthError: 'Password must be 5-16 characters',
          validationPassed: 'Validation passed',
          enterCorrectAccount: 'Please enter correct account',
          enterCorrectPassword: 'Please enter correct password',
          pleaseVerify: 'Please complete verification',
          verificationSuccess: 'Verification successful! Please proceed to login',
          // 注册表单相关
          attendee: 'Attendee',
          addAttendee: 'Add Attendee',
          name: 'Name',
          phone: 'Phone',
          mobile: 'Mobile',
          workUnit: 'Work Unit',
          affiliation: 'Affiliation/Unit',
          speechTitle: 'Speech Title/Report Title',
          title: 'Title/Job Title',
          wechat: 'WeChat',
          participationType: 'Participation Type',
          online: 'Online',
          onsite: 'Onsite',
          needAccommodation: 'Need Accommodation',
          orderNotes: 'Order Notes',
          orderNotesPlaceholder: 'Please leave your order notes',
          orderInformation: 'Order Information',
          orderNumber: 'Order Number',
          paymentAmountLabel: 'Payment Amount',
          collapseDetails: 'Collapse Details',
          conferencePeriod: 'Conference Period',
          numberOfParticipants: 'Number of Participants',
          registrationFeeDetails: 'Registration Fee Details',
          // 评论相关
          postComment: 'Post Comment',
          post: 'Post',
          insertTextHere: 'Insert text here...',
          contentCannotBeEmpty: 'Content cannot be empty',
          // 文章相关
          likes: 'Likes',
          clicks: 'Clicks',
          favorite: 'Favorite',
          like: 'Like',
          likeSuccess: 'Liked successfully',
          cancelLike: 'Like canceled',
          collectSuccess: 'Collected successfully',
          cancelCollect: 'Collection canceled',
          // 用户中心相关
          avatar: 'Avatar',
          changeAvatar: 'Change Avatar',
          changeNickname: 'Change Nickname',
          enterOriginalPassword: 'Enter Original Password',
          originalPassword: 'Original Password',
          setNewPassword: 'Set New Password',
          confirmPassword: 'Confirm Password',
          confirmModify: 'Confirm Modification',
          save: 'Save',
          userNameField: 'User Name',
          accommodationStatus: 'Need Accommodation',
          passwordMismatch: 'Passwords do not match',
          // 错误消息
          attendeeNameRequired: 'Attendee name cannot be empty',
          attendeePhoneRequired: 'Attendee phone number cannot be empty',
          attendeeWorkUnitRequired: 'Attendee work unit cannot be empty',
          attendeeSpeechTitleRequired: 'Attendee speech title cannot be empty',
          attendeeNumber: 'Attendee {index}: {field} cannot be empty'
        }
      };
      return translations[lang] && translations[lang][key] ? translations[lang][key] : key;
    },
    /**
     * 切换语言
     */
    toggleLanguage() {
      const newLang = this.currentLanguage === 'zh' ? 'en' : 'zh';
      this.$store.commit('set_language', newLang);
      // 触发页面更新
      this.$forceUpdate();
      // 更新页面标题
      if (this.$route) {
        this.updatePageTitle();
      }
    },
    /**
     * 解析双语 JSON 文本
     * @param {String} jsonStr JSON 字符串，格式为 {"zh": "中文", "en": "English"}
     * @param {String} lang 语言代码，'zh' 或 'en'，如果不提供则使用当前语言
     * @returns {String} 对应语言的文本，如果解析失败则返回原字符串
     */
    $getBilingualText(jsonStr, lang) {
      if (!jsonStr) return ''
      
      // 如果没有指定语言，使用当前语言
      if (!lang) {
        lang = this.currentLanguage || 'zh'
      }
      
      try {
        const json = JSON.parse(jsonStr)
        // 如果 JSON 中有对应语言的值，返回它
        if (json && typeof json === 'object' && json[lang] !== undefined) {
          return json[lang]
        }
        // 如果当前语言没有值，尝试返回另一种语言
        const fallbackLang = lang === 'zh' ? 'en' : 'zh'
        if (json[fallbackLang] !== undefined) {
          return json[fallbackLang]
        }
        // 如果都没有，返回第一个可用的值
        const firstValue = Object.values(json)[0]
        if (firstValue !== undefined) {
          return firstValue
        }
      } catch (e) {
        // 如果不是 JSON 格式，可能是旧数据，直接返回原值（默认为中文）
        if (lang === 'zh') {
          return jsonStr
        }
        // 英文模式下，如果原数据不是 JSON，返回空字符串
        return ''
      }
      
      return jsonStr
    },
    /**
     * 格式化日期时间（支持语言切换）
     * @param {String|Number|Date} value 日期时间值
     * @param {String} format 格式类型：'date'（日期）、'time'（时间）、'datetime'（日期时间）、'full'（完整格式）
     * @returns {String} 格式化后的日期时间字符串
     */
    $formatDateTime(value, format = 'datetime') {
      if (!value) return '';
      
      const lang = this.currentLanguage || 'zh';
      let date;
      
      // 解析日期
      if (typeof value === 'number') {
        // 时间戳
        date = new Date(value < 10000000000 ? value * 1000 : value);
      } else if (typeof value === 'string') {
        // 时间戳字符串
        if (/^\d{10,13}$/.test(value)) {
          const timestamp = value.length === 10 ? parseInt(value) * 1000 : parseInt(value);
          date = new Date(timestamp);
        } else {
          // 日期字符串
          date = new Date(value);
        }
      } else if (value instanceof Date) {
        date = value;
      } else {
        return String(value);
      }
      
      if (isNaN(date.getTime())) {
        return String(value);
      }
      
      const year = date.getFullYear();
      const month = date.getMonth() + 1;
      const day = date.getDate();
      const hours = date.getHours();
      const minutes = date.getMinutes();
      const seconds = date.getSeconds();
      
      // 英文月份名称
      const monthNamesEn = ['January', 'February', 'March', 'April', 'May', 'June',
        'July', 'August', 'September', 'October', 'November', 'December'];
      const monthNamesEnShort = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun',
        'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
      
      // 格式化数字（补零）
      const pad = (n) => String(n).padStart(2, '0');
      
      if (format === 'date') {
        // 只显示日期
        if (lang === 'zh') {
          return `${year}年${month}月${day}日`;
        } else {
          return `${monthNamesEn[month - 1]} ${day}, ${year}`;
        }
      } else if (format === 'time') {
        // 只显示时间
        return `${pad(hours)}:${pad(minutes)}`;
      } else if (format === 'datetime' || format === 'full') {
        // 显示日期和时间
        if (lang === 'zh') {
          return `${year}年${month}月${day}日 ${pad(hours)}:${pad(minutes)}${format === 'full' ? ':' + pad(seconds) : ''}`;
        } else {
          return `${monthNamesEnShort[month - 1]} ${day}, ${year} ${pad(hours)}:${pad(minutes)}${format === 'full' ? ':' + pad(seconds) : ''}`;
        }
      }
      
      // 默认格式
      if (lang === 'zh') {
        return `${year}-${pad(month)}-${pad(day)} ${pad(hours)}:${pad(minutes)}:${pad(seconds)}`;
      } else {
        return `${pad(month)}/${pad(day)}/${year} ${pad(hours)}:${pad(minutes)}:${pad(seconds)}`;
      }
    },
    /**
     * 更新页面标题
     */
    updatePageTitle() {
      const lang = this.currentLanguage;
      const title = lang === 'zh' 
        ? '学术会议管理系统'
        : 'Academic Conference Management System';
      document.title = title;
      if (document.logo !== undefined) {
        document.logo = title;
      }
    }
  },
  mounted() {
    // 组件挂载时更新页面标题
    if (this.$route) {
      this.updatePageTitle();
    }
  }
}

